package com.yingxin.yx.framework.commons.enums.task;

/**
 * 任务执行来源枚举类
 */

public enum DynamicTaskLogCategoryEnum {

    /**
     * 手动备份
     */
    MANUAL("0", "手动执行"),

    /**
     * 自动备份
     */
    AUTO("1", "自动执行");

    private String type;

    private String typeName;

    DynamicTaskLogCategoryEnum(String type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public static DynamicTaskLogCategoryEnum getEnum(String type) {
        if (type == null) {
            return null;
        }
        for (DynamicTaskLogCategoryEnum i : DynamicTaskLogCategoryEnum.values()) {
            if (i.getType().equals(type)) {
                return i;
            }
        }
        return null;
    }

}
